package com.ecoolex.chinadutyfree.retailer.ws;

import java.util.List;

import com.ecoolex.chinadutyfree.retailer.entity.DirectMailGoods;
import com.ecoolex.chinadutyfree.retailer.entity.DirectMailGoodsAudit;
import com.ecoolex.chinadutyfree.retailer.entity.DirectMailGoodsDeliveryManner;
import com.ecoolex.chinadutyfree.retailer.entity.DirectMailGoodsDummy;
import com.ecoolex.chinadutyfree.retailer.entity.DirectMailGoodsMarketing;
import com.ecoolex.chinadutyfree.retailer.entity.DirectMailGoodsProduct;
import com.ecoolex.chinadutyfree.retailer.pojo.QueryDirectMailGoodsDTO;
import com.ecoolex.chinadutyfree.retailer.pojo.QueryDirectMailGoodsMarketingDTO;
import com.ecoolex.framework.common.exception.BizException;
import com.ecoolex.framework.common.pojo.Page;
import com.ecoolex.framework.common.pojo.Pagination;
import com.ecoolex.framework.common.pojo.Sorting;


public interface DirectMailGoodsService {

	DirectMailGoods add(DirectMailGoods record, List<Integer> deliveryMannerList, String createUser) throws BizException;

	DirectMailGoods update(DirectMailGoods record, List<Integer> deliveryMannerList, String updateUser) throws BizException;

	void delete(DirectMailGoods record, String updateUser) throws BizException;

	DirectMailGoods offline(DirectMailGoods record, String updateUser) throws BizException;

	DirectMailGoods release(DirectMailGoods record, String updateUser) throws BizException;
	
	DirectMailGoods agreeDirectMailGoodsRelease(DirectMailGoods record, String updateUser) throws BizException;

	DirectMailGoods refuseDirectMailGoodsRelease(DirectMailGoods record,String auditOpinion, String updateUser) throws BizException;
	
	DirectMailGoods getById(Integer directMailGoodsId);

	Pagination<DirectMailGoods> query(QueryDirectMailGoodsDTO query, Sorting[] sorts, Page page);
	
	DirectMailGoodsAudit getAudit(Integer auditId);
	
	Pagination<DirectMailGoodsAudit> queryAudit(Sorting[] sorts, Page page);

	DirectMailGoodsProduct addProduct(DirectMailGoods goods, DirectMailGoodsProduct mailGoodsProduct, String createUser) throws BizException;

	DirectMailGoodsProduct updateProduct(DirectMailGoodsProduct mailGoodsProduct, String updateUser) throws BizException;

	void deleteProduct(DirectMailGoodsProduct mailGoodsProduct, String updateUser) throws BizException;

	DirectMailGoodsProduct getProductById(Integer directMailProductId);

	List<DirectMailGoodsProduct> queryProductAllStatusByDirectMailGoodsId(Integer directMailGoodsId);

	List<DirectMailGoodsDeliveryManner> queryDeliveryMannerByDirectMailGoodsId(Integer directMailGoodsId);

	DirectMailGoodsDummy updateDummy(DirectMailGoodsDummy record, String updateUser) throws BizException;

	DirectMailGoodsDummy getDummyByDirectMailGoodsId(Integer directMailGoodsId);

	DirectMailGoodsMarketing addMarketing(DirectMailGoodsMarketing record, String createUser) throws BizException;

	DirectMailGoodsMarketing updateMarketing(DirectMailGoodsMarketing record, String updateUser) throws BizException;

	void deleteMarketing(DirectMailGoodsMarketing record, String updateUser) throws BizException;

	DirectMailGoodsMarketing getMarketingById(Integer id);

	Pagination<DirectMailGoodsMarketing> queryMarketing(QueryDirectMailGoodsMarketingDTO query, Sorting[] sorts, Page page);

	boolean existMarketing(String position, String positionValue, Integer directMailGoodsId);

	Long sumStockNumberByDirectMailGoodsId(Integer directMailGoodsId);

	Long sumUsedStockNumberByDirectMailGoodsId(Integer directMailGoodsId);

	Long sumSoldNumberByDirectMailGoodsId(Integer directMailGoodsId);
	
	Pagination<DirectMailGoods> queryRecommendDirectMailGoodsForH5(String position,String[] positionValue,Sorting[] sorts,Page page);
	
	Pagination<DirectMailGoods> queryDirectMailGoodsForH5(String customName,Sorting[] sorts,Page page);
	
	Pagination<DirectMailGoods> queryDirectMailGoodsByCategoryIdForH5(Integer categoryId,Sorting[] sorts,Page page);
	
	Pagination<DirectMailGoods> queryDirectMailGoodsByFirstCategoryIdForH5(Integer categoryId,Sorting[] sorts,Page page);
	
	Pagination<DirectMailGoods> queryByBrandId(String name,Sorting[] sorts,Integer brandId,Page page);
	
	DirectMailGoods getByIdForH5(Integer directMailGoodsId);

	List<DirectMailGoodsProduct> queryNormalProductByDirectMailGoodsId(Integer directMailGoodsId);
	
	List<DirectMailGoods> getByGoodsId(Integer goodsId);
}
